package com.hisense.ovcloud.mqtt.warehouse.entity.device;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@Data(staticConstructor = "model")
@Table("product_info")
public class ProductInfo extends Model<ProductInfo> {

    public ProductInfo(String domain, String subDomainId, String name, String type, String model, String os, String communication, String protocol, String transportProtocol, String secType, int licenseMode, String thirdCloud, String description, int category, int deviceMode, int taskMode, int taskUpdatePolicy, String productImageUrl, long maxDeviceNum, int visibility, String deviceUplinkUrl, int departmentId, Date createTime, Date modifyTime, String manufacture, String featurecode, int productType, int brand, int msgTransType, int oneMachineOneSecret) {
        this.domain = domain;
        this.subDomainId = subDomainId;
        this.name = name;
        this.type = type;
        this.model = model;
        this.os = os;
        this.communication = communication;
        this.protocol = protocol;
        this.transportProtocol = transportProtocol;
        this.secType = secType;
        this.licenseMode = licenseMode;
        this.thirdCloud = thirdCloud;
        this.description = description;
        this.category = category;
        this.deviceMode = deviceMode;
        this.taskMode = taskMode;
        this.taskUpdatePolicy = taskUpdatePolicy;
        this.productImageUrl = productImageUrl;
        this.maxDeviceNum = maxDeviceNum;
        this.visibility = visibility;
        this.deviceUplinkUrl = deviceUplinkUrl;
        this.departmentId = departmentId;
        this.createTime = createTime;
        this.modifyTime = modifyTime;
        this.manufacture = manufacture;
        this.featurecode = featurecode;
        this.productType = productType;
        this.brand = brand;
        this.msgTransType = msgTransType;
        this.oneMachineOneSecret = oneMachineOneSecret;
    }

    public ProductInfo() {
    }

    @Column(value = "domain")
    private String domain;

    @Column(value = "sub_domain")
    private String subDomainId;

    @Column(value = "name")
    private String name;

    @Column(value = "type")
    private String type;

    @Column(value = "model")
    private String model;

    @Column(value = "os")
    private String os;

    @Column(value = "communication")
    private String communication;

    @Column(value = "protocol")
    private String protocol;

    @Column(value = "transport_protocol")
    private String transportProtocol = "tcp";

    @Column(value = "secType")
    private String secType = "RSA";

    @Column(value = "license_mode")
    private int licenseMode;

    @Column(value = "third_cloud")
    private String thirdCloud;

    @Column(value = "description")
    private String description;

    @Column(value = "category")
    private int category;

    @Column(value = "device_mode")
    private int deviceMode;

    @Column(value = "task_mode")
    private int taskMode;

    @Column(value = "task_update_policy")
    private int taskUpdatePolicy;

    @Column(value = "product_image_url")
    private String productImageUrl;

    @Column(value = "max_device_num")
    private long maxDeviceNum;

    @Column(value = "visibility")
    private int visibility;

    @Column(value = "device_uplink_url")
    private String deviceUplinkUrl = "CAN_NOT_EB_EMPTY";

    @Column(value = "department_id")
    private int departmentId;

    @Column(value = "create_time")
    private Date createTime;

    @Column(value = "modify_time")
    private Date modifyTime;

    @Column(value = "manufacture")
    private String manufacture;

    @Column(value = "featurecode")
    private String featurecode;

    @Column(value = "product_type")
    private int productType;

    @Column(value = "brand")
    private int brand;

    //[“TT” 1 , “HIMIT” 2 , “ALL” 3]
    @Column(value = "msg_trans_type")
    private int msgTransType;

    //["NO": 1, "YES": 2]
    @Column(value = "one_machine_one_secret")
    private int oneMachineOneSecret;
}
